package sqlServer;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;

public class BaseDataObject implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1238038485082479540L;
	private int objectId;
	private String objectType;
	private int objectOrder;
	private boolean objectChanged = false;
	private boolean orderChanged = false;
	private HashMap <Integer, Object[]> objectsToAddOrRemoveOnSave = new HashMap<Integer, Object[]>();
	
	public BaseDataObject() {
		// TODO Auto-generated constructor stub
	}
	
	public void setOrderChanged(boolean changed){
		orderChanged = changed;
	}
	public boolean isOrderChanged(){
		return orderChanged;
	}
	public boolean isChanged(){
		return objectChanged;
	}
	public void setChanged(boolean oc){
		objectChanged = oc;
	}
	public void setObjectId(int id){
		objectId = id;
	}
	public int getObjectId(){
		return objectId;
	}
	public void setObjectType(String type){
		objectType = type;
	}
	public String getObjectType(){
		return objectType; 
	}
	public void setObjectOrder(int order){
		objectOrder = order;
	}
	public int getObjectOrder(){
		return objectOrder;
	}
	public void addObjectOnSave(BaseDataObject obj){
		Object[] add = new Object[]{new Boolean(true),obj}; 
		objectsToAddOrRemoveOnSave.put(objectsToAddOrRemoveOnSave.size()+1, add);
	}
	public void removeObjectOnSave(BaseDataObject obj){
		Object[] add = new Object[]{new Boolean(false),obj}; 
		objectsToAddOrRemoveOnSave.put(objectsToAddOrRemoveOnSave.size()+1, add);
	}
	public void clearObjectsOnSave(){
		objectsToAddOrRemoveOnSave.clear();
	}
	public HashMap <Integer, Object[]> getObjectsToAddOrRemoveOnSave(){
		return objectsToAddOrRemoveOnSave;
	}
}
